-
Notifications
You must be signed in to change notification settings - Fork 158
style: Use require.ErrorIs whenever possible #1303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
38af157
to
1734bc4
Compare
ctx: ctx, | ||
rules: vmtest.ForkToRules(upgradetest.NoUpgrades), | ||
expectedErr: "atomic input failed verification", | ||
expectedErr: avax.ErrNilTransferableInput, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the specific error we were checking, but I'm not sure it's good practice to rely on an error "so far away"
} | ||
} else { | ||
switch { | ||
case ethHeader.ParentBeaconRoot != nil: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only moved because the test fails for a different error than what it was intending to check.
Just a question (and I'll do an actual review) - I remember talking about the |
That package is used to share errors between packages to avoid circular dependencies - for the errors I added, I didn't actually need to move them, but I definitely could. I think the package is necessary for the existing errors though |
I see - I didn't realize it was just for errors that would create circular dependencies! |
By the way the vmwrrors package should be can be removed entirely -- obviously not for this PR but if you take a look at my uplift PR Josh explained how. |
Why this should be merged
Works to follow avalanchego's linter whenever possible. Some of the ErrorContains really tested geth code, making it difficult to remove.
How this works
Uses sentinel errors and nolint clauses.
How this was tested
Existing UT
Need to be documented?
No
Need to update RELEASES.md?
No